package edu.zjut.hjg.saas.kwmp.web.controller.home;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import edu.zjut.hjg.saas.biz.model.Kindergarten;
import edu.zjut.hjg.saas.biz.service.BulletinService;
import edu.zjut.hjg.saas.common.annotation.RequestAttribute;

@Controller
@RequestMapping("/home/bulletin.htm")
public class BulletinController {

    @Autowired
    private BulletinService bulletinService;

    @RequestMapping
    public String show(@RequestAttribute Kindergarten app, Model model) {
        model.addAttribute("bulletin", bulletinService.findByAppId(app.getId()));
        return "home/bulletin";
    }
}
